package com.norteksoft.erm.model;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.apache.commons.lang.builder.HashCodeBuilder;

/**
 * @hibernate.class table="ERM_USER"
 */
public class User extends BaseObject {

	private static final long serialVersionUID = 4138778378712002262L;

	public static final String USER_STATE_NORMAL = "normal";// 用户状态：正常

	public static final String USER_STATE_LOCKED = "locked";// 用户状态：被锁定

	public static final String USER_STATE_FORBID = "forbid";// 用户状态：被禁用

	public static final String USER_STATE_DELETED = "deleted";// 用户状态：被删除

	// ~~ 非空属性 ==================================

	private Long userID = new Long(-1);// OID

	private String userName;// 用户帐号

	private String realName; // 用户姓名

	private String password;// 密码(MD5加密)

	// 用户状态: 正常normal/被锁定locked/被禁用forbid/被删除deleted。同一时刻用户只能处在一个状态中。

	private String state;

	private Integer loginFailureCount;// 连续登录失败计数器

	private Date lockDate;// 密码输错次数超限被锁定时的时间

	private String email; // 电子邮件

	private String phone; // 电话

	private Long mainGroupID;// 全职部门OID

	private List groups = new ArrayList();// 用户所属部门集（包括全职和兼职部门）

	private List roles = new ArrayList();// 用户所属角色集（包括全局和局部角色）

	private List webModules = new ArrayList();// 由我管理的子系统

	private String first;// 是否首次登录（未修改密码）: true/false

	private Date lastChpasswdDate;// 最后一次修改密码时间（为空表示强制下次登录时修改）

	private PasswordHistory passwordHistory;// 密码修改历史

	private List rights;// 用户权限集（北科工作流专用）

	private Set myFiles = new HashSet();// 用户附件集

	// ~~ ==================================

	private String editTime;// （弃用）

	private JobLevel jobLevel;// 职务级别

	private Integer displayOrder;// 显示排序（默认情况下与职务级别一致）

	private Date lastLoginDate;// 最后一次登录时间（包括本次）

	// ~~ =============================================================

	private String leader; // 是否是领导（弃用）

	private String sex; // 性别

	private String birth; // 出生日期

	private String bornPlace; // 籍贯

	private String nation; // 民族

	private String category; // 人员类别

	private String party; // 政治面貌

	private String height; // 身高

	private String weight; // 体重

	private String identity; // 身份证号码

	private String enter; // 入职日期

	private String treatment; // 享受待遇

	private String marriage; // 婚姻状况

	private String paper; // 毕业学历

	private String school; // 毕业学校

	private String specialty; // 毕业专业

	private String degree; // 毕业学位

	private String gradDay; // 毕业日期

	private String fflanguage; // 第一外语

	private String proficiency; // 熟练程度

	private String sflanguage; // 第二外语

	private String bloodType; // 血型

	private String address; // 家庭地址

	private String code; // 邮政编码

	private String cityZone; // 所属城管区

	private String marriageDay; // 结婚日期

	private String mateName; // 配偶姓名

	private String mateBirth; // 配偶出生日期

	private String mateNat; // 配偶民族

	private String mateJob; // 配偶工作单位

	private String mateAdd; // 配偶地址

	private String mateCode; // 配偶邮编

	private String mateTel; // 配偶电话

	private String father; // 父亲姓名

	private String mother; // 母亲姓名

	private String prtAdd; // 父母地址

	private String prtCode; // 父母邮编

	private String personal; // 个人爱好

	private String a1;

	private String a2;

	private String a3;

	private String a4;

	private String a5;

	private String a6;

	private String a7;

	private String a8;

	private String a9;

	private String a10;

	private String a11;

	private String a12;

	private String a13;

	private String a14;

	private String a15;

	private String a16;

	private String a17;

	private String a18;

	private String a19;

	private String a20;

	public int hashCode() {
		return new HashCodeBuilder().append(userID).append(userName).append(
				realName).append(password).append(state).append(
				loginFailureCount).append(lockDate).append(email).append(phone)
				.append(mainGroupID).append(first).append(lastChpasswdDate)
				.append(passwordHistory).append(rights).append(editTime)
				.append(displayOrder).append(lastLoginDate).append(sex).append(
						birth).append(bornPlace).append(nation)
				.append(category).append(party).append(height).append(weight)
				.append(identity).append(enter).append(treatment).append(
						marriage).append(paper).append(school)
				.append(specialty).append(degree).append(gradDay).append(
						fflanguage).append(proficiency).append(sflanguage)
				.append(bloodType).append(address).append(code)
				.append(cityZone).append(marriageDay).append(mateName).append(
						mateBirth).append(mateNat).append(mateJob).append(
						mateAdd).append(mateCode).append(mateTel)
				.append(father).append(mother).append(prtAdd).append(prtCode)
				.append(personal).append(a1).append(a2).append(a3).append(a4)
				.append(a5).append(a6).append(a7).append(a8).append(a9).append(
						a10).append(a11).append(a12).append(a13).append(a14)
				.append(a15).append(a16).append(a17).append(a18).append(a19)
				.append(a20).toHashCode();
	}

	public User() {
	}

	/**
	 * @hibernate.id generator-class="sequence" column="USERID"
	 *               unsaved-value="-1" type="long"
	 * @hibernate.generator-param name="sequence" value="ERM_SEQUENCE"
	 */

	public Long getUserID() {
		return userID;
	}

	public void setUserID(Long userID) {
		this.userID = userID;
	}

	/**
	 * @hibernate.property column="PASSWORD" length="255" type="string"
	 * @return String
	 */
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	/**
	 * @hibernate.property column="LEADER" length="255" type="string"
	 * @return String
	 */
	public String getLeader() {
		return leader;
	}

	public void setLeader(String leader) {
		this.leader = leader;
	}

	/**
	 * @hibernate.property column="EDITTIME" length="255" type="string"
	 * @return String
	 */
	public String getEditTime() {
		return editTime;
	}

	public void setEditTime(String editTime) {
		this.editTime = editTime;
	}

	/**
	 * @hibernate.property column="STATE" length="255" type="string"
	 * @return String
	 */
	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	/**
	 * @hibernate.property column="LOCKDATE" type="java.util.Date"
	 * @return Date
	 */
	public Date getLockDate() {
		return lockDate;
	}

	public void setLockDate(Date lockDate) {
		this.lockDate = lockDate;
	}

	/**
	 * @hibernate.property column="LOGINFAILURECOUNT" type="int"
	 * @return int
	 */
	public Integer getLoginFailureCount() {
		return loginFailureCount;
	}

	public void setLoginFailureCount(Integer loginFailureCount) {
		this.loginFailureCount = loginFailureCount;
	}

	/**
	 * @hibernate.property column="FIRST" length="255" type="string"
	 * @return String
	 */
	public String getFirst() {
		return first;
	}

	public void setFirst(String first) {
		this.first = first;
	}

	/**
	 * @hibernate.property column="REALNAME" length="255" type="string"
	 * @return String
	 */
	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	/**
	 * @hibernate.property column="EMAIL" length="255" type="string"
	 * @return String
	 */
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	/**
	 * @hibernate.property column="PHONE" length="255" type="string"
	 * @return String
	 */
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	/**
	 * @hibernate.property column="SEX" length="255" type="string"
	 * @return String
	 */
	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	/**
	 * @hibernate.property column="BIRTH" length="255" type="string"
	 * @return String
	 */
	public String getBirth() {
		return birth;
	}

	public void setBirth(String birth) {
		this.birth = birth;
	}

	/**
	 * @hibernate.property column="BORNPLACE" length="255" type="string"
	 * @return String
	 */
	public String getBornPlace() {
		return bornPlace;
	}

	public void setBornPlace(String bornPlace) {
		this.bornPlace = bornPlace;
	}

	/**
	 * @hibernate.property column="NATION" length="255" type="string"
	 * @return String
	 */
	public String getNation() {
		return nation;
	}

	public void setNation(String nation) {
		this.nation = nation;
	}

	/**
	 * @hibernate.property column="CATEGORY" length="255" type="string"
	 * @return String
	 */
	public String getCategory() {
		return category;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	/**
	 * @hibernate.property column="PARTY" length="255" type="string"
	 * @return String
	 */
	public String getParty() {
		return party;
	}

	public void setParty(String party) {
		this.party = party;
	}

	/**
	 * @hibernate.property column="HEIGHT" length="255" type="string"
	 * @return String
	 */
	public String getHeight() {
		return height;
	}

	public void setHeight(String height) {
		this.height = height;
	}

	/**
	 * @hibernate.property column="WEIGHT" length="255" type="string"
	 * @return String
	 */
	public String getWeight() {
		return weight;
	}

	public void setWeight(String weight) {
		this.weight = weight;
	}

	/**
	 * @hibernate.property column="IDENT" length="255" type="string"
	 * @return String
	 */
	public String getIdentity() {
		return identity;
	}

	public void setIdentity(String identity) {
		this.identity = identity;
	}

	/**
	 * @hibernate.property column="ENTER" length="255" type="string"
	 * @return String
	 */
	public String getEnter() {
		return enter;
	}

	public void setEnter(String enter) {
		this.enter = enter;
	}

	/**
	 * @hibernate.property column="TREATMENT" length="255" type="string"
	 * @return String
	 */
	public String getTreatment() {
		return treatment;
	}

	public void setTreatment(String treatment) {
		this.treatment = treatment;
	}

	/**
	 * @hibernate.property column="MARRIAGE" length="255" type="string"
	 * @return String
	 */
	public String getMarriage() {
		return marriage;
	}

	public void setMarriage(String marriage) {
		this.marriage = marriage;
	}

	/**
	 * @hibernate.property column="PAPER" length="255" type="string"
	 * @return String
	 */
	public String getPaper() {
		return paper;
	}

	public void setPaper(String paper) {
		this.paper = paper;
	}

	/**
	 * @hibernate.property column="SCHOOL" length="255" type="string"
	 * @return String
	 */
	public String getSchool() {
		return school;
	}

	public void setSchool(String school) {
		this.school = school;
	}

	/**
	 * @hibernate.property column="SPECIALTY" length="255" type="string"
	 * @return String
	 */
	public String getSpecialty() {
		return specialty;
	}

	public void setSpecialty(String specialty) {
		this.specialty = specialty;
	}

	/**
	 * @hibernate.property column="DEGREE" length="255" type="string"
	 * @return String
	 */
	public String getDegree() {
		return degree;
	}

	public void setDegree(String degree) {
		this.degree = degree;
	}

	/**
	 * @hibernate.property column="GRADDAY" length="255" type="string"
	 * @return String
	 */
	public String getGradDay() {
		return gradDay;
	}

	public void setGradDay(String gradDay) {
		this.gradDay = gradDay;
	}

	/**
	 * @hibernate.property column="FFLANGUAGE" length="255" type="string"
	 * @return String
	 */
	public String getFflanguage() {
		return fflanguage;
	}

	public void setFflanguage(String fflanguage) {
		this.fflanguage = fflanguage;
	}

	/**
	 * @hibernate.property column="PROFICIENCY" length="255" type="string"
	 * @return String
	 */
	public String getProficiency() {
		return proficiency;
	}

	public void setProficiency(String proficiency) {
		this.proficiency = proficiency;
	}

	/**
	 * @hibernate.property column="SFLANGUAGE" length="255" type="string"
	 * @return String
	 */
	public String getSflanguage() {
		return sflanguage;
	}

	public void setSflanguage(String sflanguage) {
		this.sflanguage = sflanguage;
	}

	/**
	 * @hibernate.property column="BLOODTYPE" length="255" type="string"
	 * @return String
	 */
	public String getBloodType() {
		return bloodType;
	}

	public void setBloodType(String bloodType) {
		this.bloodType = bloodType;
	}

	/**
	 * @hibernate.property column="ADDRESS" length="255" type="string"
	 * @return String
	 */
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	/**
	 * @hibernate.property column="CODE" length="255" type="string"
	 * @return String
	 */
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	/**
	 * @hibernate.property column="CITYZONE" length="255" type="string"
	 * @return String
	 */
	public String getCityZone() {
		return cityZone;
	}

	public void setCityZone(String cityZone) {
		this.cityZone = cityZone;
	}

	/**
	 * @hibernate.property column="MARRIAGEDAY" length="255" type="string"
	 * @return String
	 */
	public String getMarriageDay() {
		return marriageDay;
	}

	public void setMarriageDay(String marriageDay) {
		this.marriageDay = marriageDay;
	}

	/**
	 * @hibernate.property column="MATENAME" length="255" type="string"
	 * @return String
	 */
	public String getMateName() {
		return mateName;
	}

	public void setMateName(String mateName) {
		this.mateName = mateName;
	}

	/**
	 * @hibernate.property column="MATEBIRTH" length="255" type="string"
	 * @return String
	 */
	public String getMateBirth() {
		return mateBirth;
	}

	public void setMateBirth(String mateBirth) {
		this.mateBirth = mateBirth;
	}

	/**
	 * @hibernate.property column="MATENAT" length="255" type="string"
	 * @return String
	 */
	public String getMateNat() {
		return mateNat;
	}

	public void setMateNat(String mateNat) {
		this.mateNat = mateNat;
	}

	/**
	 * @hibernate.property column="MATEJOB" length="255" type="string"
	 * @return String
	 */
	public String getMateJob() {
		return mateJob;
	}

	public void setMateJob(String mateJob) {
		this.mateJob = mateJob;
	}

	/**
	 * @hibernate.property column="MATEADD" length="255" type="string"
	 * @return String
	 */
	public String getMateAdd() {
		return mateAdd;
	}

	public void setMateAdd(String mateAdd) {
		this.mateAdd = mateAdd;
	}

	/**
	 * @hibernate.property column="MATECODE" length="255" type="string"
	 * @return String
	 */
	public String getMateCode() {
		return mateCode;
	}

	public void setMateCode(String mateCode) {
		this.mateCode = mateCode;
	}

	/**
	 * @hibernate.property column="MATETEL" length="255" type="string"
	 * @return String
	 */
	public String getMateTel() {
		return mateTel;
	}

	public void setMateTel(String mateTel) {
		this.mateTel = mateTel;
	}

	/**
	 * @hibernate.property column="FATHER" length="255" type="string"
	 * @return String
	 */
	public String getFather() {
		return father;
	}

	public void setFather(String father) {
		this.father = father;
	}

	/**
	 * @hibernate.property column="MOTHER" length="255" type="string"
	 * @return String
	 */
	public String getMother() {
		return mother;
	}

	public void setMother(String mother) {
		this.mother = mother;
	}

	/**
	 * @hibernate.property column="PARADD" length="255" type="string"
	 * @return String
	 */
	public String getPrtAdd() {
		return prtAdd;
	}

	public void setPrtAdd(String prtAdd) {
		this.prtAdd = prtAdd;
	}

	/**
	 * @hibernate.property column="PRTCODE" length="255" type="string"
	 * @return String
	 */
	public String getPrtCode() {
		return prtCode;
	}

	public void setPrtCode(String prtCode) {
		this.prtCode = prtCode;
	}

	/**
	 * @hibernate.property column="PERSONAL" length="255" type="string"
	 * @return String
	 */
	public String getPersonal() {
		return personal;
	}

	public void setPersonal(String personal) {
		this.personal = personal;
	}

	/**
	 * @hibernate.property column="ATTRIBUTE_1" length="255" type="string"
	 * @return String
	 */
	public String getA1() {
		return a1;
	}

	public void setA1(String a1) {
		this.a1 = a1;
	}

	/**
	 * @hibernate.property column="ATTRIBUTE_2" length="255" type="string"
	 * @return String
	 */
	public String getA2() {
		return a2;
	}

	public void setA2(String a2) {
		this.a2 = a2;
	}

	/**
	 * @hibernate.property column="ATTRIBUTE_3" length="255" type="string"
	 * @return String
	 */
	public String getA3() {
		return a3;
	}

	public void setA3(String a3) {
		this.a3 = a3;
	}

	/**
	 * @hibernate.property column="ATTRIBUTE_4" length="255" type="string"
	 * @return String
	 */
	public String getA4() {
		return a4;
	}

	public void setA4(String a4) {
		this.a4 = a4;
	}

	/**
	 * @hibernate.property column="ATTRIBUTE_5" length="255" type="string"
	 * @return String
	 */
	public String getA5() {
		return a5;
	}

	public void setA5(String a5) {
		this.a5 = a5;
	}

	/**
	 * @hibernate.property column="ATTRIBUTE_6" length="255" type="string"
	 * @return String
	 */
	public String getA6() {
		return a6;
	}

	public void setA6(String a6) {
		this.a6 = a6;
	}

	/**
	 * @hibernate.property column="ATTRIBUTE_7" length="255" type="string"
	 * @return String
	 */
	public String getA7() {
		return a7;
	}

	public void setA7(String a7) {
		this.a7 = a7;
	}

	/**
	 * @hibernate.property column="ATTRIBUTE_8" length="255" type="string"
	 * @return String
	 */
	public String getA8() {
		return a8;
	}

	public void setA8(String a8) {
		this.a8 = a8;
	}

	/**
	 * @hibernate.property column="ATTRIBUTE_9" length="255" type="string"
	 * @return String
	 */
	public String getA9() {
		return a9;
	}

	public void setA9(String a9) {
		this.a9 = a9;
	}

	/**
	 * @hibernate.property column="ATTRIBUTE_10" length="255" type="string"
	 * @return String
	 */
	public String getA10() {
		return a10;
	}

	public void setA10(String a10) {
		this.a10 = a10;
	}

	/**
	 * @hibernate.property column="ATTRIBUTE_11" length="255" type="string"
	 * @return String
	 */
	public String getA11() {
		return a11;
	}

	public void setA11(String a11) {
		this.a11 = a11;
	}

	/**
	 * @hibernate.property column="ATTRIBUTE_12" length="255" type="string"
	 * @return String
	 */
	public String getA12() {
		return a12;
	}

	public void setA12(String a12) {
		this.a12 = a12;
	}

	/**
	 * @hibernate.property column="ATTRIBUTE_13" length="255" type="string"
	 * @return String
	 */
	public String getA13() {
		return a13;
	}

	public void setA13(String a13) {
		this.a13 = a13;
	}

	/**
	 * @hibernate.property column="ATTRIBUTE_14" length="255" type="string"
	 * @return String
	 */
	public String getA14() {
		return a14;
	}

	public void setA14(String a14) {
		this.a14 = a14;
	}

	/**
	 * @hibernate.property column="ATTRIBUTE_15" length="255" type="string"
	 * @return String
	 */
	public String getA15() {
		return a15;
	}

	public void setA15(String a15) {
		this.a15 = a15;
	}

	/**
	 * @hibernate.property column="ATTRIBUTE_16" length="255" type="string"
	 * @return String
	 */
	public String getA16() {
		return a16;
	}

	public void setA16(String a16) {
		this.a16 = a16;
	}

	/**
	 * @hibernate.property column="ATTRIBUTE_17" length="255" type="string"
	 * @return String
	 */
	public String getA17() {
		return a17;
	}

	public void setA17(String a17) {
		this.a17 = a17;
	}

	/**
	 * @hibernate.property column="ATTRIBUTE_18" length="255" type="string"
	 * @return String
	 */
	public String getA18() {
		return a18;
	}

	public void setA18(String a18) {
		this.a18 = a18;
	}

	/**
	 * @hibernate.property column="ATTRIBUTE_19" length="255" type="string"
	 * @return String
	 */
	public String getA19() {
		return a19;
	}

	public void setA19(String a19) {
		this.a19 = a19;
	}

	/**
	 * @hibernate.property column="ATTRIBUTE_20" length="255" type="string"
	 * @return String
	 */
	public String getA20() {
		return a20;
	}

	public void setA20(String a20) {
		this.a20 = a20;
	}

	/**
	 * @hibernate.bag name="groups" table="ERM_USER_GROUP" cascade="none"
	 *                lazy="true" inverse="false" outer-join="auto"
	 * @hibernate.key column="USERID"
	 * @hibernate.many-to-many class="com.norteksoft.erm.model.Group"
	 *                         column="GROUPID"
	 * @return List
	 */
	public List getGroups() {
		return groups;
	}

	public void setGroups(List groups) {
		this.groups = groups;
	}

	/**
	 * @hibernate.bag name="roles" table="ERM_USER_ROLE" cascade="none"
	 *                lazy="true" inverse="false" outer-join="auto"
	 * @hibernate.key column="USERID"
	 * @hibernate.many-to-many class="com.norteksoft.erm.model.Role"
	 *                         column="ROLEID"
	 * @return List
	 */
	public List getRoles() {
		return roles;
	}

	public void setRoles(List roles) {
		this.roles = roles;
	}

	/**
	 * @hibernate.bag name="rights" cascade="all-delete-orphan" lazy="true"
	 *                inverse="true"
	 * @hibernate.key column="USERID"
	 * @hibernate.one-to-many class="com.norteksoft.erm.model.UserRight"
	 * @return List
	 */
	public List getRights() {
		return rights;
	}

	public void setRights(List rights) {
		this.rights = rights;
	}

	/**
	 * @hibernate.bag name="webModules" table="ERM_USER_WEBMODULE"
	 *                cascade="none" lazy="true" inverse="false" 
	 *                outer-join="auto" 
	 * @hibernate.key column="USERID"
	 * @hibernate.many-to-many class="com.norteksoft.erm.model.WebModule"
	 *                         column="WEBMODULEID"
	 * @return List
	 */
	public List getWebModules() {
		return webModules;
	}

	public void setWebModules(List webModules) {
		this.webModules = webModules;
	}

	/**
	 * @hibernate.property type="long" column="MAINGROUPID"
	 * @return
	 */
	public Long getMainGroupID() {
		return mainGroupID;
	}

	public void setMainGroupID(Long mainGroupID) {
		this.mainGroupID = mainGroupID;
	}

	/**
	 * @hibernate.property column="USERNAME" length="255" type="string"
	 *                     not-null="true"
	 * @return String
	 */
	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	/**
	 * @deprecated Use new getUserName() method instead
	 */
	public String getUsername() {
		return userName;
	}

	/**
	 * 
	 * @deprecated Use new setUserName(String userName) method instead
	 */
	public void setUsername(String userName) {
		this.userName = userName;
	}

	/**
	 * 获得所属主部门
	 * 
	 * @return
	 */
	public Group getMyMainGroup() {
		for (Iterator iter = groups.iterator(); iter.hasNext();) {
			Group group = (Group) iter.next();
			if (group.getGroupID().equals(mainGroupID)) {
				return group;
			}
		}
		mainGroupID = null;
		return null;
	}

	/**
	 * 获得兼职部门集合
	 * 
	 * @return
	 */
	public Set getMyPartTimeGroups() {
		Set partTimeGroups = new HashSet(groups);
		partTimeGroups.remove(getMyMainGroup());
		return partTimeGroups;
	}

	/**
	 * @hibernate.set lazy="true" inverse="true" cascade="all-delete-orphan"
	 * @hibernate.key column="USERID"
	 * @hibernate.one-to-many class="com.norteksoft.erm.model.UserFile"
	 * @return Set
	 */

	public Set getMyFiles() {
		return myFiles;
	}

	public void setMyFiles(Set myFiles) {
		this.myFiles = myFiles;
	}

	public UserFile getUserFile(String fileType) {
		if (myFiles.size() == 0)
			return null;
		for (Iterator iterator = myFiles.iterator(); iterator.hasNext();) {
			UserFile userFile = (UserFile) iterator.next();
			if (userFile.getFileType().equals(fileType)) {
				return userFile;
			}
		}
		return null;
	}

	/**
	 * 更新某类型的用户附件
	 * 
	 * @param fileType
	 * @param userFile
	 */
	public void updateUserFile(String fileType, UserFile file) {
		for (Iterator iterator = myFiles.iterator(); iterator.hasNext();) {
			UserFile userFile = (UserFile) iterator.next();
			if (userFile.getFileType().equals(fileType)) {
				userFile.setUser(null);
				myFiles.remove(userFile);
				break;
			}
		}
		myFiles.add(file);
		file.setUser(this);
	}

	public String getMyGroupsAsStr() {
		return a1;
	}

	public String getMyRolesAsStr() {
		return a1;
	}

	/**
	 * @hibernate.property column="LASTCHPASSWDDATE" type="java.util.Date"
	 * @return
	 */
	public Date getLastChpasswdDate() {
		return lastChpasswdDate;
	}

	public void setLastChpasswdDate(Date lastChpasswdDate) {
		this.lastChpasswdDate = lastChpasswdDate;
	}

	/**
	 * @hibernate.component class="com.norteksoft.erm.model.PasswordHistory"
	 */
	public PasswordHistory getPasswordHistory() {
		return passwordHistory;
	}

	public void setPasswordHistory(PasswordHistory passwordHistory) {
		this.passwordHistory = passwordHistory;
	}

	/**
	 * @hibernate.property column="DISPLAYORDER" type="int"
	 * @return Integer
	 */
	public Integer getDisplayOrder() {
		return displayOrder;
	}

	public void setDisplayOrder(Integer displayOrder) {
		this.displayOrder = displayOrder;
	}

	/**
	 * @hibernate.many-to-one name="jobLevel" column="JOBLEVELOID"
	 *                        class="com.norteksoft.erm.model.JobLevel"
	 */
	public JobLevel getJobLevel() {
		return jobLevel;
	}

	public void setJobLevel(JobLevel jobLevel) {
		this.jobLevel = jobLevel;
	}

	/**
	 * @hibernate.property column="LASTLOGINDATE" type="java.util.Date"
	 * @return
	 */

	public Date getLastLoginDate() {
		return lastLoginDate;
	}

	public void setLastLoginDate(Date lastLoginDate) {
		this.lastLoginDate = lastLoginDate;
	}


}
